Skip to content

Test Common w/ multiple OTel versions & add compat with old OTel #4312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 35 commits into from
Apr 24, 2025

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented Apr 17, 2025

With the switch to OTel, the Common test suite is now dependent on an otel package, so it technically fits the toxgen usecase. By letting toxgen take care of it, we're making sure we're always testing a good range of otel versions, including the oldest one (to catch regressions) and the newest one (to catch incompatibilities early).

Couple things surfaced in terms of incompatibility with older versions:

Also included:

  • removing the opentelemetry-experimental extra (not used anymore)
  • ❗ switching to using opentelemetry-sdk instead of opentelemetry-distro -- the distro only seems to be setting up some defaults that we're not using

Closes #3241

Copy link

codecov bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.34%. Comparing base (a7e24d9) to head (4ce2167).
Report is 1 commits behind head on potel-base.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@              Coverage Diff               @@
##           potel-base    #4312      +/-   ##
==============================================
- Coverage       84.35%   84.34%   -0.01%     
==============================================
  Files             144      144              
  Lines           14629    14636       +7     
  Branches         2325     2326       +1     
==============================================
+ Hits            12340    12345       +5     
  Misses           1561     1561              
- Partials          728      730       +2     
Files with missing lines Coverage Δ
sentry_sdk/integrations/__init__.py 89.61% <ø> (ø)
sentry_sdk/opentelemetry/utils.py 82.15% <100.00%> (+0.22%) ⬆️
sentry_sdk/tracing.py 80.00% <100.00%> (+0.28%) ⬆️

... and 2 files with indirect coverage changes

@sentrivana sentrivana changed the title Determine lowest compatible OTel version and integrate in toxgen Test common test suite against a range of opentelemetry-distro version Apr 17, 2025
@sentrivana sentrivana changed the title Test common test suite against a range of opentelemetry-distro version Test common test suite against multiple opentelemetry-distro versions Apr 17, 2025
@@ -70,7 +70,6 @@ def get_file_text(file_name):
"openai": ["openai>=1.0.0", "tiktoken>=0.3.0"],
"openfeature": ["openfeature-sdk>=0.7.1"],
"opentelemetry": ["opentelemetry-distro>=0.35b0"],
"opentelemetry-experimental": ["opentelemetry-distro"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unused now

@sentrivana sentrivana changed the base branch from potel-base to ivana/potel/fix-propagate-scope-false April 17, 2025 10:58
@sentrivana sentrivana changed the title Test common test suite against multiple opentelemetry-distro versions Test common test suite against multiple OTel versions Apr 17, 2025
@sentrivana sentrivana changed the title Test common test suite against multiple OTel versions Test common against multiple OTel versions & add compat with old OTel Apr 17, 2025
@sentrivana sentrivana changed the title Test common against multiple OTel versions & add compat with old OTel Test Common against multiple OTel versions & add compat with old OTel Apr 17, 2025
@sentrivana sentrivana changed the title Test Common against multiple OTel versions & add compat with old OTel Test Common w/ multiple OTel versions & add compat with old OTel Apr 17, 2025
@sentrivana sentrivana marked this pull request as ready for review April 23, 2025 12:08
@sentrivana sentrivana requested a review from a team as a code owner April 23, 2025 12:08
Copy link
Member

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question. otherwise this look good.

gc.disable()
request.addfinalizer(gc.enable)

gc.collect()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving this line is still necessary, even if we skip this test sometimes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this makes the test suite pass locally on 3.8, so it's still an improvement though not in CI

@sl0thentr0py sl0thentr0py force-pushed the ivana/potel/fix-propagate-scope-false branch from f835a19 to a964676 Compare April 24, 2025 11:00
Base automatically changed from ivana/potel/fix-propagate-scope-false to potel-base April 24, 2025 12:45
@sentrivana sentrivana merged commit 6d2e988 into potel-base Apr 24, 2025
129 checks passed
@sentrivana sentrivana deleted the ivana/potel/determine-lowest-otel-version branch April 24, 2025 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants